package com.yunqiao.service.api;

import cn.hutool.core.lang.Dict;
import com.aliyuncs.exceptions.ClientException;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yunqiao.common.utils.PageUtils;
import com.yunqiao.service.api.entity.OrderEntity;
import com.yunqiao.service.api.vo.OrdersVo;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 订单表
 *
 * @author Crocutax
 * @email wangxw725@163.com
 * @date 2019-03-02 15:03:56
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    BigDecimal getTotalPrice(Map<String, Object> params);

    String saveOrder(OrderEntity order,Integer payType,String openId) throws Exception;

    void robOrder(Map<String, Object> params) throws ClientException;

    void claimGoods(Long orderId);

    void completeOrder(Long orderId, Integer status);

    OrdersVo getDetails(Long id);

    void cancelOrder(Long orderId, String cancelReason, Integer cancelPeople,Integer payType) throws Exception;

    Map<String, Object> getPrice(Map<String, Object> params);

    /**
     * 支付宝和微信的回调
     * @param orderNumber
     */
    String aliPaySuccess(String orderNumber) throws Exception;

    void alirefundSuccess(String orderNumber);

    Dict getFiducialPoint(Long userId);

    List<OrdersVo> queryPagev1(Map<String, Object> params);

    Long queryOrderByUserId(Long userId);
}

